#include <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;

struct Pi{
	float n,w;
};
float solve( Pi p[], int n, float w )
{
	if( w < p[n].n )
		return w/p[n].n*p[n].w;
	return p[n].w + solve(p,n+1,w-p[n].n);
}

int main()
{
	int n,need;
	cin>>n>>need;
 
	Pi P[n];	
	for(int i=0; i<n; i++){
		cin>>P[i].n;
	}	
	for(int i=0; i<n; i++){
		cin>>P[i].w;
	}	
	sort(&P[0],&P[n],[](Pi p1, Pi p2){ return p1.w/p1.n > p2.w/p2.n;});

	printf("%.2f\n",solve(P,0,need));

	return 0;
}
